package com.itqf.service.impl;

import com.itqf.mapper.DtsUserMapper;
import com.itqf.service.DtsUserService;
import com.itqf.vo.DayStatis;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * projectName: sm_project
 *
 * @author: 赵伟风
 * time: 2021/7/14 18:08
 * description:用户业务实现接口
 */
@Service
public class DtsUserServiceImpl implements DtsUserService {

    @Autowired
    private DtsUserMapper dtsUserMapper;

    public static  final Logger logger = LoggerFactory.getLogger(DtsUserServiceImpl.class);

    /**
     * 指定日期内,用户的增长量!
     *
     * @param days
     * @return
     */
    @Override
    public List<DayStatis> queryDayUser(int days) {

        if (days<=0) {
            logger.error("[用户增长业务]指定查询天数不能小于0!");
            return null;
        }

        List<DayStatis> dayStatis = dtsUserMapper.queryDay(days);

        logger.info("[用户增长业务]业务调用完毕!查询指定日期:{},用户增长数据为:{}",days,dayStatis);

        return dayStatis;
    }
}
